exports.ioListen = (http)=>{
    const io = require('socket.io')(http,{
        path: '/chat',
        serveClient: true,
        // below are engine.IO options
        pingInterval: 10000,
        pingTimeout: 5000,
        cookie: false
    });
    let count = 0;
    io.on('connection',function (client) {
        io.emit(count+=1);
        client.on('out',function (obj) {
            io.emit('off line');
        });
        client.on('send',function (obj) {
            console.log(obj);
            io.emit(obj);
        });
    });
}
